package com.criteria.filter.implbase;

import com.criteria.filter.PersonCriteria;
import com.criteria.po.Person;

import java.util.ArrayList;
import java.util.List;

public class PersonCriteriaFemale implements PersonCriteria {
    @Override
    public List<Person> streamFilterCollect(List<Person> persons) {
        List<Person> malePersons = new ArrayList<Person>();
        for (Person person : persons) {
            if(person.getGender().equalsIgnoreCase("FEMALE")){
                malePersons.add(person);
            }
        }
        return malePersons;
    }
}
